<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="jt.classic.app.dbtx.DbtxManager"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="org.limp.mine.Label"%>
<%@ page import="org.limp.mine.HTMLTool"%>
<%@ page import="org.limp.mine.StringTool"%>
<%@ page import="org.limp.mine.Controller"%>
<%@ page import="org.limp.mine.DateTrimmer"%>
<%
	String context = jt.classic.system.ISystem.getContextPath();

	Object[] result = (Object[]) request.getAttribute("result");
	Label label = (Label) result[1];
	Controller controller = (Controller) result[2];
	String pageNO = (String) result[3];
	List resultList = (List) result[0];

	String nowdate = (String) request.getAttribute("date");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>日程信息列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<jsp:include page="../head.jsp"></jsp:include>
<script>
   function handleEdit(id, date, datelabel, tp){
       if(tp == "normal"){
          parent.handleEdit(id, date, datelabel);
       }
   }
</script>
<LINK rel=stylesheet type=text/css
	href="<%=context %>/inner/app/dbtx/css/dbtx.css" media=screen></LINK>
<body style="margin-left:5px;">
<form name="form1" method="post" action=""><input type="hidden"
	name="pageNO" value="<%=pageNO%>">
<table class="tab4list" style="width:100%;">
	<tr>
		<td class="td1" width="10%">&nbsp;</td>
		<td class="td1" width="30%" align="center">&nbsp;日程主题</td>
		<td class="td1" width="60%" align="center">&nbsp;内 容</td>
	</tr>

	<%
			if (resultList != null && !resultList.isEmpty()) {
			for (int i = 0; i < resultList.size(); i++) {
				Map info = (Map) resultList.get(i);
				String number = (String) info.get("PAGINATION_NUMBER");
				String id = (String) info.get("ID");
				String title = (String) info.get("TITLE");
				String date = (String) info.get("CREATETIME");
				String type = (String) info.get("TYPE");
				String sdate = StringTool.checkString(info.get("sdate"));
				String stime = StringTool.checkString(info.get("stime"));
				String edate = StringTool.checkString(info.get("edate"));
				String etime = StringTool.checkString(info.get("etime"));
				String content = (String) info.get("CCONTENT");
				
				String timeLabel = "";
				
				if((!sdate.equals("") && !stime.equals("")) && (!edate.equals("") && !etime.equals(""))){
					timeLabel = sdate + "&nbsp;" + stime + " 至 " + edate + "&nbsp;" + etime;
				}else if(!sdate.equals("") && !stime.equals("")){
					timeLabel = sdate + "&nbsp;" + stime;
				}else if(!edate.equals("") && !etime.equals("")){
					timeLabel = edate + "&nbsp;" + etime;
				}
	%>

	<tr>
		<td align="center"><%=number%></td>
		<td>
	    <div class="divn"><%=timeLabel%></div>
		<div class="divn" style="width:250px;" title="<%=title %>">
		<%if(type.equals("normal")){ %>
		<a href="javascript:handleEdit('<%=id %>', '<%=date %>', '<%=DateTrimmer.getYMD_LBL(date) %>', '<%=type %>');"><%=title%></a>
		<%}else{ %>
		<%=title%>
		<%} %>
		</div></td>
		<td><div class="divn" title="<%=content%>"><%=content%></div></td>
	</tr>
	<%
		}
		}
	%>
</table>
<table width="700" class="tab-noborder" align="left" border="0"
	cellspacing="0" cellpadding="5">
	<tr>
		<td><%=label.displayLabel()%></td>
		<td align="right"><%=label.startLabel()%> <%=label.previousLabel()%>
		<%=label.nextLabel()%> <%=label.endLabel()%> <%=controller.getController().toString()%>
		</td>
	</tr>
</table>
<%=controller.getControlScript(true)%></form>
</body>
</html>
